import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { join } from "path";
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  //配置src目录别名
  resolve: {
    alias: {
      "@": join(__dirname, "src"),
    },
  },
   //配置代理跨域
   server: {
    proxy: {
      '/api': {
        target: 'https://api.topthink.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    }
  }
});
